package com.atguigu.gmall.order.controller;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.model.vo.order.OrderSubmitVo;
import com.atguigu.gmall.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author A
 * @version 1.0
 * @description: TODO
 * @date 2024/10/9 8:43
 */
@RestController
@RequestMapping("/api/order/auth")
public class OrderController {
    @Autowired
    OrderService orderService;
    ///api/order/auth/submitOrder?tradeNo=98990a9a51fb4b43bea6ea3c1cd820be
    @PostMapping("/submitOrder")
    public Result submitOrder(@RequestParam("tradeNo") String tradeNo,@RequestBody OrderSubmitVo orderSubmitVo){
        Long orderId = orderService.submitOrder(tradeNo, orderSubmitVo);

        return Result.ok(String.valueOf(orderId));
    }
}
